Computer programs are made up of a series of statements or instructions which when executed, cause a computer to behave in a predetermined manner. When a computer program is compiled, the source instructions are compiled or linked into machine language instructions which can then be executed by a processor in the computer. Generally, the instructions and associated data in a computer program are stored in the computer as a file which is then copied into a main memory or Random Access Memory (“RAM”) in the computer where it is executed.
Many modern computer programs are written so that program code is divided into distinct parts which are copied to segments in the RAM memory of the computer. For example, program instructions may be in one segment while program data may be in another segment. Program instructions or functions in one segment may be “called” by program code in the same segment or in a different segment to perform specific tasks. Programs are written so that “calls” to program functions in the same segment are defined as “near” calls while inter-segment calls (i.e., calls between segments) to functions are defined as “far” calls.
The only valid way to call inter-segment functions is to use “far” calls. As a result, programs containing near calls to functions in different segments generate a fixup overflow error when linked and may cause the program to malfunction when the program is executed. In the case of some computer system programs, such as a basic/input output system (“BIOS”) program, such a malfunction may be catastrophic as a computer system needs valid BIOS code to boot the computer as well as to perform other important tasks.
Current methods for detecting fixup overflow errors utilize an assembler program which is used to convert source program code to object program code. Then, a linker program is used to convert the object program code into an executable program. When a program is assembled and linked into an executable file by the linker program, the linker checks the validity of each function call defined in the segments of program code based on a default segment size of 64 kilobytes. The linker therefore validates near calls as calls to functions within 64 kilobytes of memory while validating far calls as calls to functions between segments.
There are several problems with the aforementioned current methods for detecting fixup overflow errors. One problem occurs when programmers in writing program code define segments to be less than 64 kilobytes to save space. As a result, an improper near call between two such segments with a combined length of less than 64 kilobytes will cause the assembler program to continue to build the program since the near call is within the same 64 kilobyte boundary which the assembler program processes valid near calls. In response to the near call occurring between segments, the assembler program will generate a generic warning message of a possible error as it continues to successfully build the program. However, as a result of the continuation of the build process, the warning message often goes undetected resulting in a build which may be unusable due to the invalid function call. Another problem is that although the warning may eventually be found by parsing a message log generated after the program build, finding the error requires debugging the entire program which can be a very time-consuming process.
It is with respect to these considerations and others that the present invention has been made.